uniform sampler2D texture;

varying vec3 normal;
varying vec3 lightvec;
varying float blocklight;

void main(void)
{
	vec4 lightIntensity = gl_LightSource[0].diffuse * max(dot(normal, lightvec), 0.0);
	lightIntensity.xyz += gl_LightSource[0].ambient.xyz*blocklight*0.3;
	lightIntensity.xyz *= blocklight;
	lightIntensity.w=1.0;
	
	gl_FragColor = texture2D( texture, gl_TexCoord[0].st ) * lightIntensity;
}